const http = require('http')
const fs = require('fs')

http.createServer((request, response) => { 
  console.log(request.url) 
  // 对于所有请求,都返回这个json数据.
  fs.readFile('./json.data.json', 'utf-8', (err, data) => { 
    response.end(data)
  })
}).listen(54321, () => { 
  console.log(`server is running at 54321`)
})